<?
$names = array_slice($argv, 1, count($argv) - 1);

print "Hello, ";
if ($argc == 1) {
    print "World";
}
elseif ($argc == 2) {
    print array_pop($names);
}
else {
    $last_name = array_pop($names);
    print implode(", ", $names) . ", and $last_name";
}

print "!\n";
?>
